Release 10.1A: OpenEdge Development:
Java Open Clients


Data type mapping for temp-table fields

The Java default data type mapping for the individual fields of a temp-table is different than for non-temp-table parameters, to conform to the JDBC standard. Table C–1 shows the mappings.

Table C–1: SQL ResultSet data type mappings for temp-table fields
Progress data type
Java data type
BLOB 
java.sql.Blob
Or
byte [ ] 

Note: For an INPUT temp-table, you can supply either of the two object types shown above. For output, your application can access a BLOB by calling any of three methods: getBlob() which returns a java.sql.Blob,
getBytes() which returns a byte[ ], or
getObject() which returns a java.sql.Blob.

CHARACTER 
java.lang.String 
CLOB 
java.sql.Clob 
Or
java.lang.String 

Note: For an INPUT temp-table, you can supply either of the two object types shown above. For output, your application can access a CLOB by calling any of three methods: getClob() which returns a java.sql.Clob,
getString() which returns a java.lang.String, or
getObject() which returns a java.sql.Clob.

COM-HANDLE 
Long 
DATE 
java.sql.Date
Or
java.util.GregorianCalendar

Note: For an INPUT temp-table, you can supply either of the two object types shown above. For output, your application can access a date by calling any of three methods: getDate() which returns a java.sql.Date, getGregorianCalendar() which returns a java.util.GregorianCalendar, or
getObject() which returns a java.sql.Date.

DATETIME 
java.sql.Timestamp 
Or
java.util.GregorianCalendar 

Note: For an INPUT temp-table, you can supply either of the two object types shown above. For output, your application can access a datetime by calling any of three methods: getTimestamp() which returns a java.sql.Timestamp, getGregorianCalendar() which returns a java.util.GregorianCalendar, or
getObject() which returns a java.sql.Timestamp.

DATETIME-TZ 
java.util.GregorianCalendar 
DECIMAL 
java.math.BigDecimal 
INTEGER 
Integer 
LOGICAL 
Boolean 
RAW 
byte[] 
RECID 
Long 
ROWID 
byte[] 
WIDGET-HANDLE 
Long 

Note: The column order for ResultSet objects going between a Java Open Client and the AppServer always is the default field order (physical position of the fields in the table). Normally, temp-tables have the same default field order (_order) and user-defined field order (_field-rpos). However, if the temp-table is defined using the LIKE option for a database table, and the database table has set the user-defined field order to be different than the default field order, the Java client sees the fields in the default field order, not the user-defined field order. To avoid this, define the temp-table with the individual fields LIKE the database table fields, instead of defining the whole temp-table LIKE the database table.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095